#include <glib.h>

static const gchar *HELLO = "Hello";
static const gsize N_HELLO = 5;

gint main(gint argc, gchar **argv)
{
    gconstpointer memory;
    GByteArray *array;
    GBytes *bytes;
    gint ret = -1;

    bytes = g_bytes_new (HELLO, N_HELLO);
    memory = g_bytes_get_data (bytes, NULL);
    array = g_bytes_unref_to_array (bytes);

    ret = memcmp(array->data, (guint8 *)memory, array->len);
    g_print("ret:%d \n", ret);

    ret = memcmp(array->data, (guint8 *)HELLO, N_HELLO);
    g_print("ret:%d \n", ret);

    g_byte_array_unref (array);

    return 0;
}